import 'dart:io';

import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:untitled/pages/CheckBox/checkboxDemo.dart';
import 'package:untitled/pages/CupertinoActionSheetDemo.dart';
import 'package:untitled/pages/GestureDetector/GestureDetectorDemo.dart';
import 'package:untitled/pages/Getx_project/CountMainPage.dart';
import 'package:untitled/pages/Getx_project/CountObsMainPage.dart';
import 'package:untitled/pages/Getx_project/ShopMainPage.dart';
import 'package:untitled/pages/Getx_project/TestA.dart';
import 'package:untitled/pages/Getx_project/WorkesMainPage.dart';
import 'package:untitled/pages/Getx_project/getxDemo.dart';
import 'package:untitled/pages/Image/ImagePage.dart';
import 'package:untitled/pages/ListView/listView.dart';
import 'package:untitled/pages/ListView/list_scrollController.dart';
import 'package:untitled/pages/ListView/list_smartRefresher.dart';
import 'package:untitled/pages/Radio/radioDemo.dart';
import 'package:untitled/pages/RaisedButton_demo.dart';
import 'package:untitled/pages/Switch/switchDemo.dart';
import 'package:untitled/pages/animation/animationPage.dart';
import 'package:untitled/pages/appBar/appbar_page.dart';
import 'package:untitled/pages/button/button_demo.dart';
import 'package:untitled/pages/card_demo.dart';
import 'package:untitled/pages/clip/clipDemo.dart';
import 'package:untitled/pages/container_demo.dart';
import 'package:untitled/pages/dio_net/dio_get.dart';
import 'package:untitled/pages/error_page.dart';
import 'package:untitled/pages/gridView/gridViewDemo.dart';
import 'package:untitled/pages/itying/DialogDemo.dart';
import 'package:untitled/pages/itying/DioPage.dart';
import 'package:untitled/pages/itying/FormDemo.dart';
import 'package:untitled/pages/itying/MorePage.dart';
import 'package:untitled/pages/itying/SwiperDemo.dart';
import 'package:untitled/pages/layout/FlexibleDemo.dart';
import 'package:untitled/pages/layout/TabBarDemo.dart';
import 'package:untitled/pages/layout/WrapDemo.dart';
import 'package:untitled/pages/layout/columnPage.dart';
import 'package:untitled/pages/layout/columnRow.dart';
import 'package:untitled/pages/layout/rowPage.dart';
import 'package:untitled/pages/layout/stackPage.dart';
import 'package:untitled/pages/my_navigator_observes.dart';
import 'package:untitled/pages/otherVeiw/BadgePage.dart';
import 'package:untitled/pages/otherVeiw/ListViewMonth.dart';
import 'package:untitled/pages/otherVeiw/MainFindPage.dart';
import 'package:untitled/pages/otherVeiw/StreamBuilderPage.dart';
import 'package:untitled/pages/otherVeiw/Toolitp_page.dart';
import 'package:untitled/pages/otherVeiw/WillPopScopePage.dart';
import 'package:untitled/pages/otherVeiw/imageShow.dart';
import 'package:untitled/pages/otherVeiw/listViewFag_page.dart';
import 'package:untitled/pages/otherVeiw/loadingPage.dart';
import 'package:untitled/pages/otherVeiw/phonePage.dart';
import 'package:untitled/pages/otherVeiw/physica_page.dart';
import 'package:untitled/pages/otherVeiw/progress_page.dart';
import 'package:untitled/pages/otherVeiw/segmented.dart';
import 'package:untitled/pages/otherVeiw/slidable_page.dart';
import 'package:untitled/pages/otherVeiw/slider_page.dart';
import 'package:untitled/pages/routers/router.dart';
import 'package:untitled/pages/sharedPreferences/sharedPreferencesDemo.dart';
import 'package:untitled/pages/tesxt/text_demo.dart';
import 'package:untitled/pages/textfeild/textfield_page.dart';
import 'package:untitled/pages/view/CustomScrollViewPage.dart';
import 'package:untitled/pages/view/CustomScrollViewPageII.dart';
import 'package:untitled/pages/view/NestedScrollViewDemo.dart';
import 'package:untitled/pages/view/SingleChildScrollViewDemo.dart';
import 'package:untitled/pages/view/NestedScrollViewWidget .dart';
import 'package:untitled/pages/view/Welcome.dart';
import 'package:untitled/pages/view/first_guid_page.dart';
import 'package:untitled/pages/view/home/login_page.dart';
import 'package:untitled/pages/view/home_page.dart';
import 'pages/home.dart';
import 'pages/choose_location.dart';
import 'pages/loading.dart';
import 'pages/demo_list.dart';
import 'pages/routes_demo.dart';
import 'pages/scendPage.dart';
import 'pages/scaffold_demo.dart';
import 'package:get/get.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

void main() {
  // 加入了禁止横屏的处理
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    // 使用 Getx第一步
    return ScreenUtilInit(
      designSize: Size(360, 690),
      builder: () =>
      GetMaterialApp(
        // title android 任务视图中显示的应用的名称，与ios没有任何关系，在ios中不起任何作用
        // 在ios中 任务视图的名称取的是 info.plist 文件中CFBundleDispLayName 或者CFBundleName
        title: "Flutter Demo",
        // 设置主题
        // 用来定义应用所使用的主题颜色
        // homeData 是MateialDesign Widget库的主题数据，Material库的Widget需要遵守相应设计规范
        theme: ThemeData(
          // primarySwatch 用于导航栏 ，FloatingActionButton的背景色等
          primarySwatch: Colors.lightBlue,
          // 配置应用程序的亮色 暗色 dark 白天和黑夜模式的切换
         // brightness: Brightness.light,
          textTheme:TextTheme(button: TextStyle(fontSize: 20)),
          // 配置应用程序的主背景色
           //primaryColor:Colors.blue,
          // 配置应用程序的前景色
          // 例如 进度条的前景色 开关 switch 选中的颜色 ，单选框 Radio 选中的颜色
          // 例如 输入框光标的颜色以及文本输入框默认下划线的颜色
          //accentColor: Colors.red,
          // 用来配置应用程序中 AppBar 显示的样式
          // appBarTheme: AppBarTheme(
          //   // 用来配置appBar 的背景色
          //   color: Colors.deepPurple,
          //   // 用来配置appbar 的阴影高度
          //   elevation:10.0,
          //   // 用来配置icon主题
          //   iconTheme: IconThemeData(
          //     // 用来配置appbar 上图标的颜色
          //     color: Colors.yellow,
          //     // 用来配置appbar 上图标的大小
          //     size: 33.0,
          //     // 透明度
          //     opacity: 0.3,
          //   ),
          //   actionsIconTheme: IconThemeData(
          //     color: Colors.red,
          //     size: 28.0,
          //     opacity: 1.0,
          //   )
          // ),
          // 用来配置应用程序内Icon 的样式
          // iconTheme: IconThemeData(
          //   color: Colors.red,
          //   size: 44.0,
          //   opacity: 1.0
          // ),
          // 用来配置应用程序内 Button 的样式
          buttonTheme: ButtonThemeData(
            // 文字颜色样式
            textTheme: ButtonTextTheme.normal,
            // 默认是 36.0
            //height: 44.0,
            // 默认是
            minWidth: 60.w,
            highlightColor: Colors.deepPurple,
            // 不可点击时的颜色
            disabledColor: Colors.grey,
            // RaisedButton 等使用的背景色
            buttonColor: Colors.blue,
            // 轻触时的水波纹颜色
            splashColor: Colors.yellow,
            // 鼠标悬停状态，悬停时使用的背景颜色
            hoverColor: Colors.blue,
            // 获取焦点时的颜色
            focusColor: Colors.red,
            
    
          )
    
        ),
      debugShowCheckedModeBanner: false, // 是否显示调试标识
      initialRoute: "/",  // 初始化路由
      onGenerateRoute: onGenerateRoute,
      
      // 配置404页面
      // onGenerateRoute: (RouteSettings settings){
      //   return new MaterialPageRoute(builder: (BuildContext context) => ErrorPage());
      // },
      // 监听所有的页面
      // navigatorObservers: [
      //   // 创建自定义路由监听
      //   MyNavigatorObservers(),
      // ],
      ),
    );
    
    
  }
}

